home *** CD-ROM | disk | FTP | other *** search
/ By Popular Request 2.0 / By Popular Request 2.0 (Arsenal Computer).ISO / amiga_4 / minixpkg.lha / MicroGuide.S < prev    next >
Text File  |  1995-06-06  |  2KB  |  79 lines

  1. *****************************************
  2. *        MicroGuide        *
  3. *    Small AmigaGuide-viewer        *
  4. *    V1.0 by Martin Gierich        *
  5. *    uj3w@rz.uni-karlsruhe.de    *
  6. *    Last change:02.03.95        *
  7. *****************************************
  8.                                                                  
  9. ;Copyright: Public Domain, use it at your own risk !
  10. ;Usage (CLI only): microguide <filename>
  11. ; Spaces in the filename are OK, but do not enclose it in quotes and
  12. ; do not include unneccessary spaces around the filename.
  13.  
  14. ;This is optimized for size, please tell me if you know how to make
  15. ;it even smaller. It is now 132 bytes long.
  16. ;Look out for my 488 bytes MiniXpkGuide with XPK- and WB-support.
  17.  
  18. ;Tabsize=8
  19. ;Local labels named .A to .C
  20.  
  21. ;exec.library
  22. _LVOOldOpenLibrary    = -408
  23. _LVOCloseLibrary    = -414
  24.  
  25. ;amigaguide.library
  26. _LVOOpenAmigaGuideA    = -54
  27. _LVOCloseAmigaGuide    = -66
  28.  
  29.     RSRESET
  30. ;NewAmigaGuide-structure
  31. nag_Lock    RS.L    1    Lock on the document directory
  32. nag_Name    RS.L    1    Name of document file
  33. nag_Screen    RS.L    1    Screen to place windows within
  34. nag_PubScreen    RS.L    1    Public screen name to open on
  35. nag_HostPort    RS.L    1    Application's ARexx port name
  36. nag_ClientPort    RS.L    1    Name to assign to the clients ARexx port
  37. nag_BaseName    RS.L    1    Base name of the application
  38. nag_Flags    RS.L    1    Flags
  39. nag_Context    RS.L    1    NULL terminated context table
  40. nag_Node    RS.L    1    Node to align on first (defaults to Main)
  41. nag_Line    RS.L    1    Line to align on
  42. nag_Extens    RS.L    1    Tag array extens
  43. nag_Client    RS.L    1    Private! MUST be NULL
  44. NewAmigaGuide_SIZEOF    RS.W    0
  45.  
  46.  
  47. ;Entry:    a0=pointer to LF-ended argumentline
  48. ;    d0=length of argument-line
  49. start:    moveq    #20,d3        ;set return-code to FAIL
  50.     clr.b    -1(a0,d0.l)    ;null-end argumentline
  51.     moveq    #NewAmigaGuide_SIZEOF/4-1,d0
  52. .C    clr.l    -(sp)        ;get some space for nag
  53.     dbra    d0,.C
  54.     move.l    a0,nag_Name(sp)    ;argumentline into nag
  55.  
  56.     move.l    4.w,a6        ;exec-base to a6
  57.     lea    GuideName(pc),a1
  58.     jsr    _LVOOldOpenLibrary(a6)
  59.     tst.l    d0
  60.     beq.s    .B        ;opened amigaguide.library ?
  61.     move.l    d0,a6
  62.     move.l    sp,a0        ;nag to a0
  63.     sub.l    a1,a1        ;must be zero
  64.     jsr    _LVOOpenAmigaGuideA(a6)    ;open guide
  65.     tst.l    d0
  66.     beq.s    .A        ;failed to open guide ?
  67.     move.l    d0,a0
  68.     jsr    _LVOCloseAmigaGuide(a6)    ;wait till user closes guide
  69.     moveq    #0,d3        ;set return-code to OK
  70. .A    move.l    a6,a1        ;Free all stuff
  71.     move.l    4.w,a6
  72.     jsr    _LVOCloseLibrary(a6)
  73. .B    lea    NewAmigaGuide_SIZEOF(sp),sp
  74.     move.l    d3,d0        ;set return-code
  75.     rts            ;THE END !
  76.  
  77. GuideName    dc.b    "amigaguide.library",0
  78.  
  79.